from tkinter import Frame, Checkbutton, W


class SettingGui(Frame):
	def __init__(self, root, listener):
		super().__init__(root)

		self.listener = listener

		self._run_when_ready = 0

		run_button = Checkbutton(self, text='Run when ready', variable=self._run_when_ready, command=self._change_settings, onvalue=True, offvalue=False)
		run_button.grid(row=0, column=0, sticky=W)

	def _change_settings(self):
		settings = {
			'run': self._run_when_ready,
		}

		self.listener.change_settings(settings)
